using System;
using System.Data;
using System.Collections;
using APP.QUANLY.Common;

namespace RMAS.DAL
{
    /// <summary>
    /// Summary description for QT_IMPORTBILL.
    /// </summary>
    public class QT_IMPORTBILL
    {
              private Int64 _ID;
      private string _IDCODE;
      private string _TypeBill;
      private DateTime _DateImport;
      private string _WHID_METERIAL;
      private string _WHID_MENU;
      private string _Note;
      private double _TotalMoney;
      private DateTime _DateReal;
      private Int32 _PartnerID;
      private string _Adress;
      private string _Phone;
      private double _TotalPay;
      private double _DiscountMoney;
      private double _DiscountPercent;
      private double _MoneyDiscountPercent;
      private string _UserName;
      private string _IDPOS;
      private QT_IMPORTDETIAL_MENUList _listQT_IMPORTDETIAL_MENU;
      private QT_IMPORTDETIAL_MENU_TEMPList _listQT_IMPORTDETIAL_MENU_TEMP;
      private QT_IMPORTDETIAL_METERIALList _listQT_IMPORTDETIAL_METERIAL;
      private QT_IMPORTDETIAL_METERIAL_TEMPList _listQT_IMPORTDETIAL_METERIAL_TEMP;
        private bool isExisting;
        #region Properties
        public bool IsExisting
        {
              get{return isExisting;}
              set{isExisting = value;}
        }
	      public bool IsSetIDCODE; 
      public bool IsIDCODENullable   
      { 
	 get { return false;  } 
      }
      public string IDCODE
      {
         get { return _IDCODE; }
         set 
	    { 
 		 _IDCODE = value;
		IsSetIDCODE = true;
 	    }
      }
    public bool IsSetID; 
    public bool IsIDNullable   
    { 
		get { return false;  } 
    }
    public Int64 ID
    {
        get{ return _ID;  }
        set
		{
			_ID = value;
			IsSetID = true;
		}
    }
    public bool IsSetTypeBill; 
    public bool IsTypeBillNullable   
    { 
		get { return false;  } 
    }
    public string TypeBill
    {
        get{ return _TypeBill;  }
        set
		{
			_TypeBill = value;
			IsSetTypeBill = true;
		}
    }
    public bool IsSetDateImport; 
    public bool IsDateImportNullable   
    { 
		get { return false;  } 
    }
    public DateTime DateImport
    {
        get{ return _DateImport;  }
        set
		{
			_DateImport = value;
			IsSetDateImport = true;
		}
    }
    public bool IsSetWHID_METERIAL; 
    public bool IsWHID_METERIALNullable   
    { 
		get { return false;  } 
    }
    public string WHID_METERIAL
    {
        get{ return _WHID_METERIAL;  }
        set
		{
			_WHID_METERIAL = value;
			IsSetWHID_METERIAL = true;
		}
    }
    public bool IsSetWHID_MENU; 
    public bool IsWHID_MENUNullable   
    { 
		get { return false;  } 
    }
    public string WHID_MENU
    {
        get{ return _WHID_MENU;  }
        set
		{
			_WHID_MENU = value;
			IsSetWHID_MENU = true;
		}
    }
    public bool IsSetNote; 
    public bool IsNoteNullable   
    { 
		get { return false;  } 
    }
    public string Note
    {
        get{ return _Note;  }
        set
		{
			_Note = value;
			IsSetNote = true;
		}
    }
    public bool IsSetTotalMoney; 
    public bool IsTotalMoneyNullable   
    { 
		get { return false;  } 
    }
    public double TotalMoney
    {
        get{ return _TotalMoney;  }
        set
		{
			_TotalMoney = value;
			IsSetTotalMoney = true;
		}
    }
    public bool IsSetDateReal; 
    public bool IsDateRealNullable   
    { 
		get { return false;  } 
    }
    public DateTime DateReal
    {
        get{ return _DateReal;  }
        set
		{
			_DateReal = value;
			IsSetDateReal = true;
		}
    }
    public bool IsSetPartnerID; 
    public bool IsPartnerIDNullable   
    { 
		get { return false;  } 
    }
    public Int32 PartnerID
    {
        get{ return _PartnerID;  }
        set
		{
			_PartnerID = value;
			IsSetPartnerID = true;
		}
    }
    public bool IsSetAdress; 
    public bool IsAdressNullable   
    { 
		get { return false;  } 
    }
    public string Adress
    {
        get{ return _Adress;  }
        set
		{
			_Adress = value;
			IsSetAdress = true;
		}
    }
    public bool IsSetPhone; 
    public bool IsPhoneNullable   
    { 
		get { return false;  } 
    }
    public string Phone
    {
        get{ return _Phone;  }
        set
		{
			_Phone = value;
			IsSetPhone = true;
		}
    }
    public bool IsSetTotalPay; 
    public bool IsTotalPayNullable   
    { 
		get { return false;  } 
    }
    public double TotalPay
    {
        get{ return _TotalPay;  }
        set
		{
			_TotalPay = value;
			IsSetTotalPay = true;
		}
    }
    public bool IsSetDiscountMoney; 
    public bool IsDiscountMoneyNullable   
    { 
		get { return false;  } 
    }
    public double DiscountMoney
    {
        get{ return _DiscountMoney;  }
        set
		{
			_DiscountMoney = value;
			IsSetDiscountMoney = true;
		}
    }
    public bool IsSetDiscountPercent; 
    public bool IsDiscountPercentNullable   
    { 
		get { return false;  } 
    }
    public double DiscountPercent
    {
        get{ return _DiscountPercent;  }
        set
		{
			_DiscountPercent = value;
			IsSetDiscountPercent = true;
		}
    }
    public bool IsSetMoneyDiscountPercent; 
    public bool IsMoneyDiscountPercentNullable   
    { 
		get { return false;  } 
    }
    public double MoneyDiscountPercent
    {
        get{ return _MoneyDiscountPercent;  }
        set
		{
			_MoneyDiscountPercent = value;
			IsSetMoneyDiscountPercent = true;
		}
    }
    public bool IsSetUserName; 
    public bool IsUserNameNullable   
    { 
		get { return false;  } 
    }
    public string UserName
    {
        get{ return _UserName;  }
        set
		{
			_UserName = value;
			IsSetUserName = true;
		}
    }
    public bool IsSetIDPOS; 
    public bool IsIDPOSNullable   
    { 
		get { return false;  } 
    }
    public string IDPOS
    {
        get{ return _IDPOS;  }
        set
		{
			_IDPOS = value;
			IsSetIDPOS = true;
		}
    }
public QT_IMPORTDETIAL_MENUList QT_IMPORTDETIAL_MENUList 
{ 
	get { return _listQT_IMPORTDETIAL_MENU; }
	set { _listQT_IMPORTDETIAL_MENU = value;}
}
public QT_IMPORTDETIAL_MENU_TEMPList QT_IMPORTDETIAL_MENU_TEMPList 
{ 
	get { return _listQT_IMPORTDETIAL_MENU_TEMP; }
	set { _listQT_IMPORTDETIAL_MENU_TEMP = value;}
}
public QT_IMPORTDETIAL_METERIALList QT_IMPORTDETIAL_METERIALList 
{ 
	get { return _listQT_IMPORTDETIAL_METERIAL; }
	set { _listQT_IMPORTDETIAL_METERIAL = value;}
}
public QT_IMPORTDETIAL_METERIAL_TEMPList QT_IMPORTDETIAL_METERIAL_TEMPList 
{ 
	get { return _listQT_IMPORTDETIAL_METERIAL_TEMP; }
	set { _listQT_IMPORTDETIAL_METERIAL_TEMP = value;}
}

        #endregion

        #region Constructors
        public QT_IMPORTBILL()
        {
            Reset();
        }
        public QT_IMPORTBILL(QT_IMPORTBILL obj)
        {
            	this._ID = obj.ID;
	this._IDCODE = obj.IDCODE;
	this._TypeBill = obj.TypeBill;
	this._DateImport = obj.DateImport;
	this._WHID_METERIAL = obj.WHID_METERIAL;
	this._WHID_MENU = obj.WHID_MENU;
	this._Note = obj.Note;
	this._TotalMoney = obj.TotalMoney;
	this._DateReal = obj.DateReal;
	this._PartnerID = obj.PartnerID;
	this._Adress = obj.Adress;
	this._Phone = obj.Phone;
	this._TotalPay = obj.TotalPay;
	this._DiscountMoney = obj.DiscountMoney;
	this._DiscountPercent = obj.DiscountPercent;
	this._MoneyDiscountPercent = obj.MoneyDiscountPercent;
	this._UserName = obj.UserName;
	this._IDPOS = obj.IDPOS;
        }
        #endregion

        public void Reset()
        {
                     _ID = EmptyValues.v_Int64;
         _IDCODE = EmptyValues.v_string;
         _TypeBill = EmptyValues.v_string;
         _DateImport = EmptyValues.v_DateTime;
         _WHID_METERIAL = EmptyValues.v_string;
         _WHID_MENU = EmptyValues.v_string;
         _Note = EmptyValues.v_string;
         _TotalMoney = EmptyValues.v_double;
         _DateReal = EmptyValues.v_DateTime;
         _PartnerID = EmptyValues.v_Int32;
         _Adress = EmptyValues.v_string;
         _Phone = EmptyValues.v_string;
         _TotalPay = EmptyValues.v_double;
         _DiscountMoney = EmptyValues.v_double;
         _DiscountPercent = EmptyValues.v_double;
         _MoneyDiscountPercent = EmptyValues.v_double;
         _UserName = EmptyValues.v_string;
         _IDPOS = EmptyValues.v_string;
	_listQT_IMPORTDETIAL_MENU = null;
	_listQT_IMPORTDETIAL_MENU_TEMP = null;
	_listQT_IMPORTDETIAL_METERIAL = null;
	_listQT_IMPORTDETIAL_METERIAL_TEMP = null;
        }

         
        #region Hidden

        /*
        private void readProperties(IDataReader reader)
        {
            try
            {
                                if(!(reader["ID"] is DBNull))
		{
			obj.ID = (Int64)reader["ID"];
		}
                if(!(reader["IDCODE"] is DBNull))
		{
			obj.IDCODE = (string)reader["IDCODE"];
		}
                if(!(reader["TypeBill"] is DBNull))
		{
			obj.TypeBill = (string)reader["TypeBill"];
		}
                if(!(reader["DateImport"] is DBNull))
		{
			obj.DateImport = (DateTime)reader["DateImport"];
		}
                if(!(reader["WHID_METERIAL"] is DBNull))
		{
			obj.WHID_METERIAL = (string)reader["WHID_METERIAL"];
		}
                if(!(reader["WHID_MENU"] is DBNull))
		{
			obj.WHID_MENU = (string)reader["WHID_MENU"];
		}
                if(!(reader["Note"] is DBNull))
		{
			obj.Note = (string)reader["Note"];
		}
                if(!(reader["TotalMoney"] is DBNull))
		{
			obj.TotalMoney = (double)reader["TotalMoney"];
		}
                if(!(reader["DateReal"] is DBNull))
		{
			obj.DateReal = (DateTime)reader["DateReal"];
		}
                if(!(reader["PartnerID"] is DBNull))
		{
			obj.PartnerID = (Int32)reader["PartnerID"];
		}
                if(!(reader["Adress"] is DBNull))
		{
			obj.Adress = (string)reader["Adress"];
		}
                if(!(reader["Phone"] is DBNull))
		{
			obj.Phone = (string)reader["Phone"];
		}
                if(!(reader["TotalPay"] is DBNull))
		{
			obj.TotalPay = (double)reader["TotalPay"];
		}
                if(!(reader["DiscountMoney"] is DBNull))
		{
			obj.DiscountMoney = (double)reader["DiscountMoney"];
		}
                if(!(reader["DiscountPercent"] is DBNull))
		{
			obj.DiscountPercent = (double)reader["DiscountPercent"];
		}
                if(!(reader["MoneyDiscountPercent"] is DBNull))
		{
			obj.MoneyDiscountPercent = (double)reader["MoneyDiscountPercent"];
		}
                if(!(reader["UserName"] is DBNull))
		{
			obj.UserName = (string)reader["UserName"];
		}
                if(!(reader["IDPOS"] is DBNull))
		{
			obj.IDPOS = (string)reader["IDPOS"];
		}
//            _ID = (reader["ID"] is DBNull)?DalTools.EmptyValues.v_Int64:(Int64)reader["ID"];
//            _IDCODE = (reader["IDCODE"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["IDCODE"];
//            _TypeBill = (reader["TypeBill"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["TypeBill"];
//            _DateImport = (reader["DateImport"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["DateImport"];
//            _WHID_METERIAL = (reader["WHID_METERIAL"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["WHID_METERIAL"];
//            _WHID_MENU = (reader["WHID_MENU"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["WHID_MENU"];
//            _Note = (reader["Note"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Note"];
//            _TotalMoney = (reader["TotalMoney"] is DBNull)?DalTools.EmptyValues.v_double:(double)reader["TotalMoney"];
//            _DateReal = (reader["DateReal"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["DateReal"];
//            _PartnerID = (reader["PartnerID"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["PartnerID"];
//            _Adress = (reader["Adress"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Adress"];
//            _Phone = (reader["Phone"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Phone"];
//            _TotalPay = (reader["TotalPay"] is DBNull)?DalTools.EmptyValues.v_double:(double)reader["TotalPay"];
//            _DiscountMoney = (reader["DiscountMoney"] is DBNull)?DalTools.EmptyValues.v_double:(double)reader["DiscountMoney"];
//            _DiscountPercent = (reader["DiscountPercent"] is DBNull)?DalTools.EmptyValues.v_double:(double)reader["DiscountPercent"];
//            _MoneyDiscountPercent = (reader["MoneyDiscountPercent"] is DBNull)?DalTools.EmptyValues.v_double:(double)reader["MoneyDiscountPercent"];
//            _UserName = (reader["UserName"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["UserName"];
//            _IDPOS = (reader["IDPOS"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["IDPOS"];
            }
            catch (Exception ex)
            {
                throw new DalException("Failed to read properties from DataReader.", ex);
            }
        } 
        */

        #endregion


        public void Fill(string IDCODE, Int64 ID, string TypeBill, DateTime DateImport, string WHID_METERIAL, string WHID_MENU, string Note, double TotalMoney, DateTime DateReal, Int32 PartnerID, string Adress, string Phone, double TotalPay, double DiscountMoney, double DiscountPercent, double MoneyDiscountPercent, string UserName, string IDPOS)
        {
                     this._ID = ID;
         this._IDCODE = IDCODE;
         this._TypeBill = TypeBill;
         this._DateImport = DateImport;
         this._WHID_METERIAL = WHID_METERIAL;
         this._WHID_MENU = WHID_MENU;
         this._Note = Note;
         this._TotalMoney = TotalMoney;
         this._DateReal = DateReal;
         this._PartnerID = PartnerID;
         this._Adress = Adress;
         this._Phone = Phone;
         this._TotalPay = TotalPay;
         this._DiscountMoney = DiscountMoney;
         this._DiscountPercent = DiscountPercent;
         this._MoneyDiscountPercent = MoneyDiscountPercent;
         this._UserName = UserName;
         this._IDPOS = IDPOS;
        }
    }
}